<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册页</title>
    <!-- 导入css文件 -->
    <link rel="stylesheet" href="../static/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/css/register.css">
    <!-- 导入浏览器图标 -->
    <link rel="shortcut icon" href="../static/imgs/icecream.ico">
</head>

<body>
    <div class="card">
        <div class="card-body">
            <form>
                <div class="form-group">
                    <label for="exampleInputEmail1" style="margin-left: 40px;">
                        <h2>注册您的宝贝账号！</h2>
                    </label>
                    <input type="username" class="form-control" id="uid" aria-describedby="userHelp"
                        placeholder="请输入账号">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" id="pwd" placeholder="请输入密码">
                </div>
                <div class="forn-group">
                    <input type="repssword" class="form-control" id="repwd" placeholder="确认密码">
                </div>
                <button type="button" class="btn btn-primary" style="width: 80px;" onclick="register()">注册</button>
                <br>
                <div id="abc">
                    <a href="./login.html" onclick="returnlg()">已有账号?立即登录</a>
                </div>

            </form>
        </div>
    </div>


    <script>
        //注册
        function register(){
            //获取账号
            let username = $('#uid').val();
            //获取密码
            let password = $('#pwd').val();
            //获取确认密码
            let repwd = $('#repwd').val();
        }
        //注册判断
        if(username === ''){
            alert('账号不能为空！请检查后重试');
        }
        else if(password === ''){
            alert('密码不能为空!请检查后重试')
        }
        else if(repwd === ''){
            alert('确认密码不能为空！请检查后重试')
        }
        else if(repwd !== password){
            alert('两次密码不一致，请重试！')
        }
        else{
            alert('恭喜你，注册成功！')
            window.location.href = './login.html';
        };

    </script>

</body>

</html>